IF EXISTS (SELECT 1 FROM master.dbo.sysdatabases WHERE name = 'TS')
BEGIN
	DROP DATABASE TS;
END
GO